Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support generate & format test files #112

Merged
merged 7 commits into from
Dec 7, 2022
Merged

Conversation

xxchan
Copy link
Member

@xxchan xxchan commented Dec 6, 2022

  • add CLI option --override, and --format
  • type string and column number not checked yet (verify column in option is the same as provided input #36), but it would be easy. We need to update the engines first.
  • breaking changes to Record and parser
    • retain Include record when linking its content
    • keep parsing after Halt
    • move Begin/EndInclude to Injected
  • breaking change: remove Hook

sample run: risingwavelabs/risingwave#6776

close #43
close #90

@xxchan xxchan requested review from skyzh and wangrunji0408 December 6, 2022 21:59
Copy link
Member

@wangrunji0408 wangrunji0408 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🤯

Comment on lines 51 to 52
// FIXME:
// _ => Err(ParseErrorKind::InvalidType(c)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't decided what's the final way yet. 🤪 How do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's discuss how to handle type-string here #36

Comment on lines 476 to 478
if let Some(hook) = &mut self.hook {
hook.on_stmt_complete(&sql).await;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hook should be called after comparing the result.
Nevertheless, the hook feature can be removed now as we no longer use it. 🤪

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hook should be called after comparing the result.

Why? Do you mean only run hooks if query/statement succeed?

the hook feature can be removed now as we no longer use it.

I'm not sure but it maybe useful sometimes #88 🤪

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only run hooks if query/statement succeed?

Previous implementation is indeed on_query_succeed_and_pass_test 🤪. Maybe we will also need others like on_query_succeed_and_fail_test... It's a little bit tricker than I thought.

Since no one is using it now, let's secretly remove it; Redesign and add back in future if needed. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

generate test result using actual output of a run
2 participants